﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using PPI.Entities.Interface;
using PPI.Mobile;
using VMind.Global;

namespace PPI.ServiceLogic
{
    public class LXMissionStructures_PoleTreatments : IMobileTable
    {
        public LXMissionStructures_PoleTreatments()
        {
        }

        public static DataSet SelectAllIdName(string connectionKey)
        {
            return PPI.Data.DXMissionStructures_PoleTreatments.SelectAllIdName(connectionKey);

        }

        public List<EMobileQuery> CreateInsertMobileQuery(string connectionKey)
        {
            List<EMobileQuery> listQueries = new List<EMobileQuery>();
            StringBuilder _Sql = new StringBuilder();
            DataTable _Dt = SelectAllIdName(connectionKey).Tables[0];

            listQueries.Add(new EMobileQuery("Delete tb_Lookups where LookupTypeFk ='Treatments'"));
            foreach (DataRow dr in _Dt.Rows)
            {
                listQueries.Add(new EMobileQuery("insert into tb_Lookups (LookupValue, LookupText, LookupTypeFk) values (" + ConvertHelper.ToInt32(dr["XMissionStructures_PoleTreatmentId"]) + ",'" + dr["Name"].ToString() + "','Treatments')"));
            }
            return listQueries;
        }
    }
}
